<!--  获取当前时间戳，并且支持时间戳转换   -->
<template>
  <div class="container">

    <!--
      参考：http://tool.aliy7.com/
    -->

    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="#">Home</a></li>
        <li class="breadcrumb-item"><a href="#">Library</a></li>
        <li class="breadcrumb-item active" aria-current="page">Data</li>
      </ol>
    </nav>

    <h4>Timestamp</h4>
    <input @click="getCurrentTimestamp" type="button" value="点击获得当前时间戳">
    <p>{{ timestamp }}</p>
    <input @click="currentTimeToTimestamp" type="text" value="当前时间转换为时间戳">

  </div>
</template>

<script>


  export default {
    data() {
      return {
        timestamp: 0,
      }
    },
    created () {
    },
    methods: {
      getCurrentTimestamp() {
        this.timestamp = Math.round(new Date().getTime()/1000);
      },
      /*  设置时间转换成为时间戳  */
      currentTimeToTimestamp() {
        var date = new Date();
      }
    }
  }
</script>


<style scoped>

</style>
